Skip to content

Conversation

gjulivan
Copy link
Collaborator

@gjulivan gjulivan commented Aug 10, 2025

Pull request type


Description

pdfjs-dist version has to be the same with react-pdf dependency
https://github.com/wojtekmaj/react-pdf/blob/5e0d135f5d1d3a3cec4628a2fc05a4a8f0bed9e7/packages/react-pdf/package.json#L60
this version use "4.8.69"

@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch 6 times, most recently from 03e05ee to 2f12295 Compare August 11, 2025 20:01
@gjulivan gjulivan marked this pull request as ready for review August 11, 2025 20:02
@gjulivan gjulivan requested a review from a team as a code owner August 11, 2025 20:02
@gjulivan gjulivan changed the title Retrieve pdfjs worker locally instead of cdn [WC-3050] Retrieve pdfjs worker locally instead of cdn Aug 11, 2025
@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch 2 times, most recently from 7908040 to 2bddeee Compare August 12, 2025 11:15
iobuhov
iobuhov previously approved these changes Aug 14, 2025
Copy link
Collaborator

@iobuhov iobuhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch 2 times, most recently from 27561ca to 6d4485d Compare August 19, 2025 22:20
@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch 2 times, most recently from e7af5a5 to c05c050 Compare August 29, 2025 08:20
@gjulivan gjulivan assigned gjulivan and unassigned gjulivan Aug 29, 2025
@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch from c05c050 to 3c1a7c7 Compare August 29, 2025 08:35
@gjulivan gjulivan closed this Aug 29, 2025
@gjulivan gjulivan reopened this Aug 29, 2025
@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch from 3c1a7c7 to a69bc3e Compare August 29, 2025 09:38
@Copilot Copilot AI review requested due to automatic review settings August 29, 2025 09:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the Document Viewer widget to bundle PDF.js worker files locally instead of loading them from a CDN, improving Content Security Policy (CSP) compliance. The changes involve downgrading the pdfjs-dist dependency to maintain compatibility with react-pdf.

  • Configures Rollup to copy PDF.js worker files, cmaps, and standard fonts to the local build
  • Updates PDF.js worker URL configuration to use local paths instead of CDN URLs
  • Downgrades pdfjs-dist from version 5.0.375 to 4.8.69 for react-pdf compatibility

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
rollup.config.mjs Adds copy plugin to bundle PDF.js worker files and dependencies locally
package.json Bumps version to 1.1.0 and downgrades pdfjs-dist to 4.8.69 for compatibility
PDFViewer.tsx Updates worker and resource URLs to use local paths instead of CDN
CHANGELOG.md Documents the change to local PDF.js worker bundling
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch from a69bc3e to 3c4fbde Compare August 29, 2025 13:22
@gjulivan gjulivan force-pushed the document-viewer-local-pdfjs branch from 3c4fbde to cdfa90f Compare September 4, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants